package com.powernode.ssm.springAnalysis.a12.def_JDK.d3;


import java.lang.reflect.Method;

public class $Proxy3 implements D3.Foo3 {

    private D3.InvocationHandler invocationHandler;

    public $Proxy3(D3.InvocationHandler invocationHandler){
        //1
        this.invocationHandler = invocationHandler;
    }

    @Override
    public void foo() throws Throwable {
        //获取调用方法的方法对象
        Method foo = D3.Foo3.class.getMethod("foo");
        //接口回调，执行增强逻辑，同时把方法对象作为参数传入
        invocationHandler.invoke(foo,new Object[0]);
    }

    @Override
    public void bar() throws Throwable {
        //3
        Method bar = D3.Foo3.class.getMethod("bar");
        invocationHandler.invoke(bar, new Object[0]);
    }
}
